Skip to content

fix(harness): align subagent task output timeout#1452

Open
luowanghaoyun wants to merge 1 commit into
agentscope-ai:mainfrom
luowanghaoyun:fix/subagent-task-output-timeout
Open

fix(harness): align subagent task output timeout#1452
luowanghaoyun wants to merge 1 commit into
agentscope-ai:mainfrom
luowanghaoyun:fix/subagent-task-output-timeout

Conversation

@luowanghaoyun
Copy link
Copy Markdown

Fixes #1451

Ensure HarnessAgent tool execution timeout exceeds task_output blocking waits and include tool identifiers in timeout errors.

AgentScope-Java Version

1.1.0-SNAPSHOT

Description

Background

When HarnessAgent enables subagent orchestration, task_output supports blocking up to 10 minutes via its timeout parameter (max: 600000 ms). However, the default tool execution configuration (ExecutionConfig.TOOL_DEFAULTS) applies a 5-minute timeout at the framework level.

As a result, a long-running task_output(block=true, timeout=600000) call can be interrupted by the tool executor before the tool's own wait limit is reached.

Changes

  1. TaskTool

    • Introduce shared constants MAX_BLOCK_WAIT_MILLIS / MAX_BLOCK_WAIT (10 minutes) and reuse them in task_output timeout clamping.
  2. HarnessAgent

    • When subagents are enabled, raise the effective tool execution timeout to TaskTool.MAX_BLOCK_WAIT + 1 minute (11 minutes) if the user config is unset or not greater than 10 minutes.
    • Apply subagent hook registration and timeout adjustment in the same code path.
  3. ToolExecutor

    • Improve timeout error messages to include tool name and tool call id, e.g.
      Tool 'task_output' (id=...) execution timeout after PT5M.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Ensure HarnessAgent tool execution timeout exceeds task_output blocking waits and include tool identifiers in timeout errors.
@luowanghaoyun luowanghaoyun requested a review from a team May 20, 2026 14:05
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:HarnessAgent subagent task_output may be interrupted by default tool execution timeout

2 participants